<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('请假审批列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('oa:leaveCheck:edit')}]];
    var removeFlag = [[${@permission.hasPermi('oa:leaveCheck:remove')}]];
    var statusDatas = [[${@dict.getType('sys_leave_status')}]];
    var prefix = ctx + "oa/leaveCheck";

    $(function () {
        var options = {
            url: prefix + "/list",
            detailUrl: prefix + "/leaveCheckDetail/{id}",
            modalName: "请假审批",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'leave.id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'flowCategoryInfo.name',
                    title: '流程类型'
                },
                {
                    field: 'leave.sysUser.userName',
                    title: '流程申请人'
                },
                {
                    field: 'status',
                    title: '审批状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    }
                },
                {
                    field: 'createDate',
                    title: '创建时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.leave.id + ',' + row.status + '\',\'true\')"><i class="fa fa-edit"></i>查看详情</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>